package com.study.talk.module.netty.message.response;

import com.study.talk.module.entity.GroupInfo;
import com.study.talk.module.entity.Message;
import com.study.talk.module.entity.User;
import com.study.talk.module.entity.UserInfo;
import com.study.talk.module.netty.message.MessageType;
import com.study.talk.module.netty.message.TalkMessage;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 *  登录消息响应
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class LoginResponse extends TalkMessage {

    @ApiModelProperty("用户id")
    private Integer userId;

    @ApiModelProperty("用户账户")
    private String username;

    @ApiModelProperty("用户是否登录成功")
    private Boolean success;

    @ApiModelProperty("登录token")
    private String token;

    @ApiModelProperty("原因")
    private String reason;

    @ApiModelProperty("用户账号")
    private User user;

    @ApiModelProperty("用户信息")
    private UserInfo userInfo;

    @ApiModelProperty("用户好友列表")
    public List<UserInfo> friendList;

    @ApiModelProperty("用户群聊列表")
    public List<GroupInfo> groupList;

    @Override
    public byte getType() {
        return MessageType.LOGIN_RESPONSE;
    }
}
